package com.enoram.gwt.desktop.client;

import com.enoram.gwt.desktop.client.ui.DeskItem;
import com.enoram.gwt.desktop.client.ui.DesktopView;
import com.enoram.gwt.desktop.client.ui.Token;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Desktop implements EntryPoint {
	interface Images extends ClientBundle{
		ImageResource deskitem();
		ImageResource members();
		ImageResource offices();
		ImageResource invoice();
		
		ImageResource documents();
		ImageResource repair();
		ImageResource status();
		
	}
	private Images images = GWT.create(Images.class);
	private DockLayoutPanel outer = new DockLayoutPanel(Unit.PX);
	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {

		if(RootPanel.get("testDesktopId")!=null){
			final RootPanel root = RootPanel.get("testDesktopId");
		DesktopView desktop = new DesktopView();
		
		
		outer.addNorth(new Label(),80);
		outer.add(desktop);
		
		
		DeskItem item1 = new DeskItem("Office", images.offices(), new Token("office"));
		DeskItem item2 = new DeskItem("Member", images.members() , new Token("member"));
		DeskItem item3 = new DeskItem("Billing/Invoice", images.invoice() , new Token("billing"));
		
		DeskItem item4 = new DeskItem("Document", images.documents() , new Token("documents"));
		DeskItem item5 = new DeskItem("Repair", images.repair() , new Token("repair"));
		DeskItem item6 = new DeskItem("Status", images.status() , new Token("status"));
		
		desktop.add(item1);desktop.add(item2); desktop.add(item3); 		
		desktop.add(item4); desktop.add(item5);desktop.add(item6);		
		
		
		 root.add(desktop);		 
		}
		 
		 //desktop.addTop(new Label("status"));
		
	}

}
